﻿using ASmile.Com;
using ASmile.Com.Da;
using ASmile.Com.GridView;
using ASmile.DBModel;
using Microsoft.AspNetCore.Mvc;

namespace ASmile.Web.ApiControllers.SysManage
{
    /// <summary>
    /// GridView配置
    /// </summary>
    [Route("api/SysManage/[controller]/[action]")]
    [ApiExplorerSettings(GroupName = "SysManage")]
    public class GridViewController : BaseApiCrudController<GridViewBLL,Sys_GridColumn, ArgGetList>
        //BaseApiController<GridViewBLL>
    {
        /// <summary>
        /// 根据form名称及dgv名称获取列名,参数：{FormName:"",DgvName:""}
        /// </summary>
        [HttpPost]
        [UserAuthorize(true, false)]
        public ApiResultList<Sys_GridColumn> GetColumnInfo(ArgGetList arg)
        {
            return BLLObj.GetColumnInfo(arg);
        }
        ///// <summary>
        ///// 获取分页数据
        ///// </summary>
        //[HttpPost]
        //public ApiResultList<Sys_GridColumn> GetData(ArgPageData arg)
        //{
        //    return BLLObj.GetData(arg);
        //}
        /// <summary>
        /// 新增
        /// </summary>
        //[HttpPost]
        //public virtual ApiResult<string> Add(Sys_GridColumn model)
        //{
        //    return BLLObj.Add(model);
        //}
        ///// <summary>
        ///// 更新
        ///// </summary>
        //[HttpPost]
        //public virtual ApiResult<string> Edit(Sys_GridColumn model)
        //{
        //    return BLLObj.Edit(model);
        //}
        ///// <summary>
        ///// 删除
        ///// </summary>
        //[HttpPost]
        //public ApiResult Del(Sys_GridColumn model)
        //{
        //    return BLLObj.Del(model);
        //}
        /// <summary>
        /// 修改列索引(排序) ,只需要赋值 ,Id 与 ColumnIndex
        /// </summary>
        [HttpPost]
        public ApiResult SetColumnIndex(ArgSetSortNo arg)
        {
            return BLLObj.SetColumnIndex(arg);
        }
        /// <summary>
        /// 交换两个行数据的排序
        /// </summary>
        [HttpPost]
        public ApiResult SwapOrderNo(ArgSwapOrderNo arg)
        {
            return BLLObj.SwapOrderNo(arg);
        }
    }
}